const http = require('http');
const fs  = require('fs');
const readStream = fs.createReadStream(__dirname + '/stream.html');
http.createServer(function (request, response) {
  // 'Content-Type': 'text/html'： 输出html内容
  response.writeHead(200, { 'Content-Type': 'text/html' });
  readStream.pipe(response);
}).listen(8081);

console.log('Server running at http://127.0.0.1:8081/');